//
//  HomePageUserNewsContentCell.m
//  ShowYork
//
//  Created by hxh on 2020/9/29.
//  Copyright © 2020 hxh. All rights reserved.
//

#import "HomePageUserNewsContentCell.h"

@interface HomePageUserNewsContentCell ()
@property (nonatomic,strong)UILabel *contentLb;
@property (nonatomic,strong)UILabel *photoCountLb;
@end

@implementation HomePageUserNewsContentCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setUI];
    }
    return self;
}

- (void)setUI{
    self.contentLb = [[UILabel alloc]init];
    self.contentLb.textColor = UIColor.whiteColor;
    self.contentLb.font = font(14);
    self.contentLb.numberOfLines = 3;
    [self.contentView addSubview:self.contentLb];
    
    self.photoCountLb = [[UILabel alloc]init];
    self.photoCountLb.text = @"共1张";
    self.photoCountLb.textColor = UIColor.whiteColor;
    self.photoCountLb.font = font(12);
    [self.contentView addSubview:self.photoCountLb];
    
    [self.contentLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView).offset(8);
        make.right.equalTo(self.contentView).offset(-13);
        make.top.equalTo(self.contentView);
    }];
    
    [self.photoCountLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.contentView);
        make.left.equalTo(self.contentView).offset(8);
    }];

}
- (void)setNewContent:(NSString *)content andMaxImgCount:(NSInteger)maxCount{
    self.contentLb.text = content;
    if (maxCount <= 1) {
        self.photoCountLb.text = @"";
    }else{
        self.photoCountLb.text = [NSString stringWithFormat:@"共%lu张",maxCount];
    }
    
    
}

@end
